package com.arpa.wms.service;


import com.arpa.wms.domain.dto.BatchRuleDTO;
import com.arpa.wms.domain.dto.BatchRuleFormDTO;
import com.arpa.wms.domain.entity.BatchRule;
import com.arpa.wms.domain.enums.StatusEnum;
import com.arpa.wms.domain.vo.BatchRuleVO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 批次规则 服务类
 * </p>
 *
 * @author LEO
 * @since 2020-08-11
 */
public interface IBatchRuleService extends IService<BatchRule> {

    /**
     * 保存
     * @param entity
     * @return
     */
    @Override
    boolean save(BatchRule entity);

    /**
     * 根据code更新实体
     * @param entity
     * @return
     */
    int updateByCode(BatchRuleFormDTO entity);

    /**
     * 查询列表
     * @param batchRuleDTO
     * @return
     */
    List<BatchRuleVO> queryList(BatchRuleDTO batchRuleDTO);

     /**
      *  @author: Allen chen
      *  @Date: 2020/10/12 17:12
      *  @Description: 根据code批量查询
      */
    List<BatchRuleVO> queryByCodes(List<String> codes);

     /**
      *  @author: Allen chen
      *  @Date: 2020/9/22 13:50
      *  @Description: 批量查询
      */
    List<BatchRuleVO> getListByCodes(List<String> codes);

    /**
     * 查询合计,包含总数
     * @param batchRuleDTO
     * @return
     */
    BatchRuleVO queryListSum(BatchRuleDTO batchRuleDTO);

    BatchRuleVO findVoByreceiveItemCode(String receiveItemCode);

    BatchRuleVO findVoByGoods(String goodCode);

    void batchdel(List<String> codes);

    Map<String,Object> activeStatus(List<String> code, StatusEnum active);



    /**
     * 通过code删除
     * @param codes
     */
    Map<String,Object> removeByCode(List<String> codes);


    /**
     * 获取货主批次信息
     * @param shipmentCode
     * @return
     */
    List<Map<String, Object>> findByShipmentCode(String shipmentCode);

    /**
     * 获取批次信息
     * @param code
     * @return
     */
    BatchRuleVO getByCode(String code);
}
